import axios from 'axios'
import React, { useEffect, useState } from 'react'
import { useParams } from 'react-router-dom'

function Xq() {
    const {id}=useParams()
    const [list,setList]=useState([])
    const getdata=async ()=>{
        const res= await axios.get('/api/list/detail',{params:{
            id:id
        }})
        console.log(res.data.data);
        
        setList(res.data.data)
    }

    useEffect(()=>{
        getdata()
    },[])
  return (
    <div>
        <div>
            {
                list&&(
                    <dl>
                        <dt>
                            <h1>{list.title}</h1>
                            <h2>{list.title}</h2>
                            <h3>{list.data}</h3>
                            <hh3>{list.price}</hh3>
                        </dt>
                        <dd>
                            <img src={list.image} alt="" />
                        </dd>
                    </dl>
                )
            }
        </div>
    </div>
  )
}

export default Xq